xattr Functions
PHP Manual

xattr_get

(PECL xattr >= 0.9.0)

xattr_get Obtiene un atributo extendido

Descripción

string xattr_get ( string $nombre_archivo , string $nombre [, int $opciones ] )

La función obtiene el valor de un atributo extendido del archivo.

Extended attributes have two different namespaces: user and root. The user namespace is available to all users, while the root namespace is available only to users with root privileges. xattr operates on the user namespace by default, but this can be changed with the flags parameter.

Lista de parámetros

nombre_archivo

El archivo del que se quiere obtener el atributo.

nombre

Nombre del atributo extendido.

opciones

Opciones de xattr soportadas
XATTR_DONTFOLLOW Realizar las operaciones en el propio enlace simbólico (no seguirlo).
XATTR_ROOT Establecer atributo en el espacio de nombres raíz (y de confianza). Requiere privilegios de root.

Valores retornados

Devuelve una cadena que contiene el valor del atributo o FALSE si el atributo no existe.

Ejemplos

Example #1 Comprueba si el administrador del sistema ha firmado el archivo

<?php
$archivo 
'/usr/local/sbin/ejecutable_binario';
$firma xattr_get($archivo'Root signature'XATTR_ROOT);

/* ... comprobar si la firma es valida ... */

?>

Ver también


xattr Functions
PHP Manual